name: build
on: [push, pull_request]
jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        python: [3.12, 3.8]
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: ${{ matrix.python }}
      - run: pip install -r requirements.txt
      - uses: ankane/setup-postgres@v1
        with:
          database: pgvector_python_test
          dev-files: true
      - run: |
          cd /tmp
          git clone --branch v0.6.2 https://github.com/pgvector/pgvector.git
          cd pgvector
          make
          sudo make install
      - run: pytest
